package day22.SecondTest;

import java.util.Scanner;
class Employee {
    private int salary;

    public Employee(int salary) {
        this.salary = salary;
    }

    public int getSalary() {
        return salary;

    }

    public void setSalary(int salary) {
        this.salary = salary;
    }

    public String toString() {
        return "Employee{salary = " + salary + "}";
    }

    public void main() {
        System.out.println(salary);
    }
}
class Manager extends Employee{

    public Manager(int salary) {
        super(salary);
    }

    public String toString() {
        return "Manager{}";
    }

}
class Salesman extends Employee {
    private int salary2;

    public Salesman(int salary, int salary2) {
        super(salary);
        this.salary2 = salary2;
    }

    public String toString() {
        return "Salesman{}";
    }

    public int getSalary() {
        return salary2 + super.getSalary();
    }
}
class Worker extends Employee {
    private int days;

    public Worker(int days, int salary) {
        super(salary);
        this.days = days;
    }

    public int getSalary() {
        return days * super.getSalary();
    }
}

public class Main1{
    public static void main(String[] args) {

        Scanner scan = new Scanner(System.in);
        int managerSalary = scan.nextInt();
        int salemanSalary = scan.nextInt();
        int salemanRaise = scan.nextInt();
        int workerEveryday = scan.nextInt();
        int workerDays = scan.nextInt();

        Employee e1 = new Manager(managerSalary);
        Employee e2 = new Salesman(salemanSalary, salemanRaise);
        Employee e3 = new Worker(workerEveryday, workerDays);

        System.out.println(e1.getSalary());
        System.out.println(e2.getSalary());
        System.out.println(e3.getSalary());

        scan.close();


    }
}